Skip to content

Conversation

@dairui1
Copy link
Contributor

@dairui1 dairui1 commented Jan 25, 2025

Description

I encountered the same issue in Roo-Code as described in Cline cline/cline#1336. The problem was resolved through cline/cline#1397, so I applied @luohy15's changes from Cline to Roo Code.

Additionally, it allows using Cloudflare AI Gateway to access OpenRouter requests, enabling more detailed logging and other features.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

I built Roo-Code locally and tested OpenRouter requests with Cloudflare AI Gateway. The requests were successful without any errors. After testing, I can confirm this solution effectively resolves the issue.

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers


Important

Adds openRouterBaseUrl option for customizable API base URL in OpenRouter integration, with updates to configuration, UI, and testing.

  • Behavior:
    • Adds openRouterBaseUrl option to OpenRouterHandler in openrouter.ts for customizable API base URL.
    • Updates ClineProvider to handle openRouterBaseUrl in global state and API configuration.
    • Adds UI elements in ApiOptions.tsx for setting openRouterBaseUrl.
  • Configuration:
    • Updates ApiHandlerOptions in api.ts to include openRouterBaseUrl.
    • Modifies ClineProvider to manage openRouterBaseUrl in global state.
  • UI:
    • Adds checkbox and text field in ApiOptions.tsx for openRouterBaseUrl input.
  • Testing:
    • Tested with Cloudflare AI Gateway to ensure requests succeed with custom base URL.

This description was created by Ellipsis for 304f5a0979ededd1de997f43522006611929cde1. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Jan 25, 2025

⚠️ No Changeset found

Latest commit: 3d5780f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dairui1 dairui1 closed this Jan 25, 2025
@dairui1 dairui1 reopened this Jan 25, 2025
@dairui1 dairui1 force-pushed the feat/openrouter_base_url branch from 304f5a0 to 4a75f85 Compare January 25, 2025 09:12
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a small fix to match the other PR better. Thank you for your contribution!

@mrubens mrubens merged commit 2fbf276 into RooCodeInc:main Jan 26, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants